Skip to content

docs(cards): PATCH /cards/{id} is platform-authenticated, not SCA-railed - #799

Open
kphurley7 wants to merge 2 commits into
mainfrom
kph/cards-patch-no-sca
Open

docs(cards): PATCH /cards/{id} is platform-authenticated, not SCA-railed#799
kphurley7 wants to merge 2 commits into
mainfrom
kph/cards-patch-no-sca

Conversation

@kphurley7

Copy link
Copy Markdown
Contributor

Reason

PATCH /cards/{id} documented a 202 -> signed-retry flow that the implementation never had: it returns 200 directly, authenticated by the platform credential. One of the two has to give.

The spec should give, because the documented flow is wrong for this verb. The 202 pattern signs the challenge with the session private key of a verified authentication credential on the card's owning internal account - the end user's key. That models actions taken by a user on their own credentials or funds, which is why DELETE /auth/credentials/{id} and POST /internal-accounts/{id}/export use it.

Freezing or closing a card is routinely an action taken about a user and without them present: fraud response, offboarding, an ops-driven freeze. Under the documented flow none of those are possible through the public API, and the cardholder may be the adversary. We would have had to add a platform-authenticated bypass almost immediately, and that bypass would have become the path everyone actually used.

Overview

  • Drops the 202 -> signed-retry prose and replaces it with why this endpoint is platform-authenticated.
  • Drops the Grid-Wallet-Signature and Request-Id header parameters.
  • Drops the 202 response.
  • 200 is no longer described as "signed retry accepted".
  • Rewrites the 401 description, which described signature and challenge failures.

Sensitive-data operations stay SCA-railed: POST /cards/{id}/reveal and 3DS password retrieval are unchanged, because there the cardholder is the party being served and user-present signing is the right model.

Notes

No implementation change accompanies this - sparkcore already behaves this way, so this closes the divergence rather than opening one. Nothing is affected downstream: the card program is gated behind GRID_CARD_PROGRAM_ENABLED and is not public.

Redocly validates clean; warning count unchanged at 50, none in this file. Spectral does not run locally (see #795).

The spec described a 202 -> signed-retry flow that the implementation never
had. Rather than build it, drop it: the pattern signs with the session key of
a credential on the owning internal account, so requiring it would make a
platform unable to freeze or close a card without the cardholder present -
which is exactly the fraud-response and offboarding case the verb exists for.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JsJUrc9YRcfxEFqgXQEYvD
@vercel

vercel Bot commented Aug 5, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
grid-flow-builder Ignored Ignored Preview Aug 11, 2026 2:42pm
grid-wallet-demo Ignored Ignored Preview Aug 11, 2026 2:42pm

Request Review

@kphurley7
kphurley7 marked this pull request as ready for review August 11, 2026 14:41
The split source edit (drop the 202 -> signed-retry flow on PATCH /cards/{id})
was not reflected in the compiled openapi.yaml / mintlify/openapi.yaml, so the
"Build OpenAPI Documentation" check failed on out-of-sync bundles. Regenerated
via `make build`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B1EQw7zvv37yerH6cccwrV
@github-actions github-actions Bot added the breaking-change Introduces a breaking change to the OpenAPI spec label Aug 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Breaking OpenAPI changes detected

oasdiff reports 1 error / 2 warning changes to openapi.yaml.
This PR will need approval from an API reviewer before merge.

Errors (1)

  • PATCH /cards/{id} — removed the success response with the status 202 [response-success-status-removed].

Warnings (2)

Show sample
  • PATCH /cards/{id} — deleted the header request parameter Grid-Wallet-Signature [request-parameter-removed]. This is a warning because some apps may return an error when receiving a parameter that they do not expect. It is recommended to deprecate the parameter first.
  • PATCH /cards/{id} — deleted the header request parameter Request-Id [request-parameter-removed]. This is a warning because some apps may return an error when receiving a parameter that they do not expect. It is recommended to deprecate the parameter first.

Detected by oasdiff. Full report: job summary or the oasdiff-report artifact.

@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

✱ Stainless preview builds for grid

This PR will update the grid SDKs with the following commit messages.

cli

feat(api): remove grid-wallet-signature and request-id headers from cards update

go

fix(api): remove signature auth parameters from cards update method

kotlin

fix(api): remove gridWalletSignature and requestId params from card update

openapi

feat(api): remove signed-retry pattern from cards update endpoint

php

fix(api): remove gridWalletSignature and requestID parameters from cards update method

python

feat(api): remove grid_wallet_signature and request_id parameters from cards update method

ruby

fix(api): remove grid_wallet_signature and request_id from cards update

typescript

fix(api): remove Grid-Wallet-Signature and Request-Id params from cards.update

Edit this comment to update them. They will appear in their respective SDK's changelogs.

grid-typescript studio · code · diff

Your SDK build had at least one "note" diagnostic, but this did not represent a regression.
generate ✅build ✅lint ❗test ✅

npm install https://pkg.stainless.com/s/grid-typescript/fb807f33112e94d1fb3000b1faea90bdfa4b6f73/dist.tar.gz
grid-openapi studio · code · diff

Your SDK build had at least one "warning" diagnostic, but this did not represent a regression.
generate ⚠️

grid-ruby studio · code · diff

Your SDK build had at least one "note" diagnostic, but this did not represent a regression.
generate ✅build ✅lint ✅test ✅

grid-go studio · code · diff

Your SDK build had at least one "note" diagnostic, but this did not represent a regression.
generate ✅build ✅lint ❗test ❗

go get github.com/stainless-sdks/grid-go@dfc2cf1caf38a5c4f62ec1223550d168ae16fb92
grid-kotlin studio · code · diff

Your SDK build had at least one "warning" diagnostic, but this did not represent a regression.
generate ⚠️build ✅lint ✅test ❗

grid-python studio · code · diff

generate ✅build ⏳lint ❗test ❗

grid-php studio · code · diff

Your SDK build had at least one "note" diagnostic, but this did not represent a regression.
generate ✅lint ✅test ✅

grid-cli studio · code · diff

Your SDK build had at least one "warning" diagnostic, but this did not represent a regression.
generate ⚠️build ❗lint ❗test ❗

⏳ These are partial results; builds are still running.


This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push.
If you push custom code to the preview branch, re-run this workflow to update the comment.
Last updated: 2026-08-11 14:53:49 UTC

@greptile-apps

greptile-apps Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR revises PATCH /cards/{id} to document platform-credential authentication and a direct 200 response rather than a signed-retry challenge.

  • Removes the signing headers and 202 challenge response from the modular operation.
  • Rewrites the operation rationale and authentication-error description.
  • Leaves generated OpenAPI bundles and related card guides on the previous signed-retry contract.

Confidence Score: 4/5

The PR should not merge until the generated OpenAPI bundles and card guides are synchronized with the revised endpoint contract.

The source operation now advertises direct platform-authenticated updates, while tracked bundles and user-facing guides still publish the removed signed-retry flow, and the repository’s consistency check will fail.

Files Needing Attention: openapi/paths/cards/cards_{id}.yaml, openapi.yaml, mintlify/openapi.yaml, and mintlify/snippets/cards/

Important Files Changed

Filename Overview
openapi/paths/cards/cards_{id}.yaml The operation is internally consistent after removing signed retry, but the source-only edit leaves required generated bundles and related guides stale.
Prompt To Fix All With AI
### Issue 1
openapi/paths/cards/cards_{id}.yaml:73-76
**Generated card contract remains stale**

When this source-only change enters the normal build and publishing workflows, the committed OpenAPI bundles and card guides retain the removed signing headers, `202` response, and signed-retry instructions, causing the consistency check to fail while SDK previews and readers receive a contract that contradicts this operation. Rebuild the tracked bundles and update the related card snippets with this change.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (1): Last reviewed commit: "docs(cards): PATCH /cards/{id} is platfo..." | Re-trigger Greptile

Comment on lines +73 to +76
This endpoint is authenticated by the platform credential alone and
returns `200` directly. It deliberately does not use Grid's 202 →
signed-retry pattern: that pattern signs with the session key of a
credential on the owning internal account, so it models actions taken

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Generated card contract remains stale

When this source-only change enters the normal build and publishing workflows, the committed OpenAPI bundles and card guides retain the removed signing headers, 202 response, and signed-retry instructions, causing the consistency check to fail while SDK previews and readers receive a contract that contradicts this operation. Rebuild the tracked bundles and update the related card snippets with this change.

Context Used: CLAUDE.md (source)

Knowledge Base Used: Cards

Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/paths/cards/cards_{id}.yaml
Line: 73-76

Comment:
**Generated card contract remains stale**

When this source-only change enters the normal build and publishing workflows, the committed OpenAPI bundles and card guides retain the removed signing headers, `202` response, and signed-retry instructions, causing the consistency check to fail while SDK previews and readers receive a contract that contradicts this operation. Rebuild the tracked bundles and update the related card snippets with this change.

**Context Used:** CLAUDE.md ([source](https://github.com/lightsparkdev/grid-api/blob/main/CLAUDE.md))

**Knowledge Base Used:** [Cards](https://app.greptile.com/lightspark/-/custom-context/knowledge-base/lightsparkdev/grid-api/-/docs/cards.md)

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change Introduces a breaking change to the OpenAPI spec

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant